package view.plotter

class PlotManager {
	def plotFrames = [:]
	
	def penToFrame = [:]
	
	def addFrame(String fname){
		Plotter p = new Plotter(fname)
		plotFrames[fname] = p
		//println "添加frame${plotFrames[fname]}"
	}
	
	def addPen(frameName, penName){
		//println "添加画笔${penName}"
		((Plotter)plotFrames[frameName]).addPen(penName)
		
		penToFrame[penName]=frameName
		
		//println plotFrames[penName]
	}
	
	def show(){
		plotFrames.each{key,value ->
			value.show()
		}
	}
	
	def reset(){
		plotFrames.each{key,value ->
			value.reset()
		}
	}
	
	def plot(String penName, value){
		Plotter p = plotFrames[penToFrame[penName]]
		p.plot(penName, value)
	}
	
	def init(){
		
	}
	
	def update(){
		
	}
}





